% PhD thesis "Example", Markus Kuhn, Univ. of Cambridge, 2002
% Modified by Salvatore Scellato, Univ. of Cambridge, 2011
%
\documentclass[12pt,twoside,openright,a4paper]{report} % techreport version
%\documentclass[12pt,oneside,a4paper]{report} % hardbound submitted thesis version
%\usepackage{amsfonts}
\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage{bibunits}
%\usepackage{backref}
\usepackage{color}
\usepackage{enumitem}
\usepackage{epigraph}
\usepackage{fancyhdr}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{hyperref}

\hypersetup{
  colorlinks=false,       % false: boxed links; true: colored links
  linkcolor=magenta,          % color of internal links 
  citecolor=brown,        % color of links to bibliography
  filecolor=magenta,      % color of file links
  urlcolor=cyan,           % color of external links
  bookmarksopen = true,
  bookmarksnumbered = true,
  breaklinks = true,
  linktocpage
}
%\usepackage[colon,longnamesfirst]{natbib}
\usepackage{multirow}
\usepackage[helvetica]{quotchap}
\usepackage{subfigure}
\usepackage{titlesec}
\usepackage{url}

% Setting the offsets to 'zero' (LaTeX calculates offsets 1in from the left 
%  and upper edges of the page) makes the calculation of margins a bit easier.

\setlength{\hoffset}{-1in}

% some format settings
% for hard-bound final submission, use:
%\setlength{\oddsidemargin}{35mm}     % 30 mm left margin - 1 in
% for soft-bound version and techreport, use instead:
\setlength{\oddsidemargin}{35mm}    % 30 mm left margin - 1 in
\setlength{\evensidemargin}{25mm}
\setlength{\topmargin}{-5.4mm}        % 20 mm top margin - 1 in
\setlength{\textwidth}{150mm}         % 20/25 mm right margin
\setlength{\textheight}{247mm}        % 20 mm bottom margin
\setlength{\headheight}{5mm}
\setlength{\headsep}{5mm}
\setlength{\parindent}{0mm}
\setlength{\parskip}{\medskipamount}

\setcounter{tocdepth}{1}

\newcommand{\cm}[1]{\footnote{\textbf{\textcolor{red}{Cecilia: #1}}}}
\newcommand{\sa}[1]{\footnote{\textbf{\textcolor{red}{Salvo: #1}}}}
\newcommand{\impl}{\textbf{Implication: }}
\newcommand{\furl}[1]{\footnote{\url{http://#1}}}
\newcommand{\mytitle}{Spatial properties of online social services:
  \\measurement, analysis and applications}
\renewcommand\baselinestretch{1.2} % thesis format (not needed for techreport)

% don't let large figures hijack entire pages
\renewcommand\topfraction{.9}
\renewcommand\textfraction{.1}
\renewcommand\floatpagefraction{.8}
%\newcommand{\todo}[1]{\textbf{\large\textcolor{blue}{[#1]}}}
\newcommand{\todo}[1]{}

\newcommand{\plotscale}{0.75\columnwidth}
\newcommand{\plotscalebig}{0.9\columnwidth}
\newcommand{\doubleplotscale}{0.48\columnwidth}
\newcommand{\tripleplotscale}{0.48\columnwidth}
\newcommand{\emt}[1]{\ensuremath{#1}}

% start of document
\begin{document}

\input{title}
\cleardoublepage

\vspace*{60mm}
\textbf{\Large Declaration}
\vspace{10mm}

This dissertation is the result of my own work and includes
nothing which is the outcome of work done in collaboration except
where specifically indicated in the text.

\bigskip
This dissertation does not exceed the regulation length of $60\,000$
words, including tables and footnotes.

\cleardoublepage

\input{abstract}
\clearpage

\input{acknowledgments}
\clearpage

%\tableofcontents

\pagestyle{fancy}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\tableofcontents
\cleardoublepage % start chapter 1 on odd page
\pagestyle{fancy}

% specify headers for first page of chapter
\catcode`\$=9 % ignore the dollar sign (for RCS ID)
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

% specify headers for rest of document
%\fancyhf{} % clear all header and footer fields
%\fancyhead[RE]{\slshape \rightmark}
%\fancyhead[LO]{\slshape \leftmark}
%\fancyhead[LE,RO]{\thepage}
%\renewcommand{\headrulewidth}{0.4 pt}
%\renewcommand{\footrulewidth}{0 pt}
%\catcode`\$=3 % restore normal meaning of $

%\pagestyle{fancy}
%
\renewcommand{\headrulewidth}{0pt}
\fancyhead[LE,LO]{\slshape \rightmark}
\fancyhead[RO,RE]{\slshape \leftmark} 
\fancyfoot[C]{\thepage}

%\renewcommand{\chaptermark}[1]{Chapter \markboth{#1}{}}
\renewcommand{\sectionmark}[1]{}%\markright{\thesection \  #1}{}}

\input{introduction}

\input{social_nets}

\input{structure}

\input{model}

\input{prediction}

\input{caching}

\input{conclusion}

\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
\setlength{\parskip}{0ex}%
\setlength{\itemsep}{3ex}%
}%
{%
\end{oldthebibliography}%
}

\addcontentsline{toc}{chapter}{Bibliography}  

%\renewcommand{\etalchar}[1]{#1}
%\bibliographystyle{plain}
\bibliographystyle{amsalpha}
\bibliography{biblio}

\end{document}
